package com.filetransfer.api.upload;
import com.filetransfer.api.generated.invoker.ApiClient;

import okhttp3.Call;
import okhttp3.Request;
public class ProgressRequestHelper {
    public static Call CloneCallWithProgress(ApiClient client, Call httpCall, ProgressListener progressListener) {
        Request originalRequest = httpCall.request();
        var originalBody = originalRequest.body();
        Request newRequest = originalRequest.newBuilder().method(originalRequest.method(), new ProgressRequestBody(originalBody, progressListener)).build();
        httpCall = client.getHttpClient().newCall(newRequest);
        return httpCall;
    }
}
